
cmake_minimum_required(VERSION 3.4)

project(G4Improve VERSION 1.0)

find_package(Geant4 REQUIRED ui_all vis_all)

include(${Geant4_USE_FILE})

include_directories(${PROJECT_SOURCE_DIR}/inc)

file(GLOB sources ${PROJECT_SOURCE_DIR}/src/*.cc)
file(GLOB headers ${PROJECT_SOURCE_DIR}/inc/*.hh)

add_executable(G4Improve G4Improve.cc ${sources} ${headers})

target_link_libraries(G4Improve ${Geant4_LIBRARIES})

set(EXAMPLEB1_SCRIPTS
  auto.mac
  vis.mac
)

foreach(_script ${EXAMPLEB1_SCRIPTS})
  configure_file(
    ${PROJECT_SOURCE_DIR}/${_script}
    ${PROJECT_BINARY_DIR}/${_script}
    COPYONLY
    )
endforeach()

install(TARGETS G4Improve DESTINATION bin)

add_custom_target(B1 DEPENDS G4Improve)

